#pragma once
#include <Ice\Ice.h>
#include <IceStorm\IceStorm.h>
namespace Xts
{
	namespace IceRuntime
	{
		class XStormBase
		{
		public:
			XStormBase(const Ice::CommunicatorPtr& pIc, const Ice::LoggerPtr& pLogger);
			~XStormBase(void);

			bool IsTopicManagerValid();
			bool InitTopicManager(const std::string& topicManagerDsb);

		protected:
			Ice::CommunicatorPtr x_pIc;
			Ice::LoggerPtr x_pLogger;
			IceStorm::QoS x_qos;
			IceStorm::TopicManagerPrx x_topicManagerPrx;

			//Retrieving a topic proxy, if the topic does not exist, try to create a new one. Return NULL if failed. 
			IceStorm::TopicPrx RetrieveTopic(const std::string& topicName);
		};
		
	}
}


